package com.jackie.coupon.template.converter;

import com.jackie.coupon.template.api.beans.CouponTemplateInfo;
import com.jackie.coupon.template.dao.entiry.CouponTemplate;

/**
 * CouponTemplateConverter
 *
 * @author Jackie Hou
 * @date 2023/11/17 09:15
 * @version 1.0
 */
public class CouponTemplateConverter {

    public static CouponTemplateInfo convert2TemplateInfo(CouponTemplate template) {


        CouponTemplateInfo couponTemplateInfo = CouponTemplateInfo.builder()
                .id(template.getId())
                .name(template.getName())
                .desc(template.getDescription())
                .shopId(template.getShopId())
                .available(template.getAvailable())
                .build();

        return couponTemplateInfo;
    }
}
